#define _CRT_SECURE_NO_WARNINGS
int reverse(int x)
{
    int flag = 1;
    unsigned int a = 0;
    if (x < 0)
    {
        flag = -1;
        a = -x;
    }
    else
    {
        a = x;
    }
    unsigned int tmp = a;
    int rev = 0;
    int len = 0;
    while (tmp)
    {
        len++;
        tmp /= 10;
    }
    if (len == 10)
    {                 //2147483647
        if (flag = 1)    //7463847412
        {

        }

    }
    while (len)
    {
        rev += a % 10 * pow(10, len - 1);
        a /= 10;
        len--;
    }
    int ret = flag * rev;
    return ret;
}